// src/socket.js
import { io } from 'socket.io-client';

const socket = io('http://59.110.225.60:5000');

socket.on('connect', () => {
  console.log('Connected to Socket.IO server');
});

socket.on('train_started', (data) => {
  console.log('Train started:', data.message);
  // 显示开始训练的消息
});

socket.on('train_progress', (data) => {
  console.log('Training progress:', data);
  // 显示训练进度，可以在页面上更新进度条
});

socket.on('train_ended', (data) => {
  console.log('Train ended:', data.message);
  // 显示训练结束的消息
});

export default socket;
